import React, { Component } from 'react';
import { Switch, Route, Redirect } from 'react-router-dom';
import Site from './Site';
import Hot from './Hot';
import Pop from './Pop';
import './../lastupload.scss';
import AllUpdateNav from '@/components/works/works-base/AllUpdateNav';
class Com extends Component {
  constructor(props) {
    super(props);
    this.state = {
      Loginlist:[
        {
          path: '/works/allupdate/site',
          name: '最新上传'
        },
        {
          path: '/works/allupdate/hot',
          name: '正在流行'
        },
        {
          path: '/works/allupdate/pop',
          name: '24小时最佳'
        }
      ]
    }
  }
  render () {
    return (
      <div className="works-update">
        <div className="works-allupdate">
        <AllUpdateNav Loginlist = { this.state.Loginlist } {...this.props}/>
          <Switch>
            <Route path = "/works/allupdate/site" component = { Site } />
            <Route path = "/works/allupdate/hot" component = { Hot } />
            <Route path = "/works/allupdate/pop" component = { Pop } />
            <Redirect from = "/works/allupdate" to = "/works/allupdate/site"/>
          </Switch>
        </div>
      </div>  
    )
  }
}

export default Com;
